import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);


const store = new Vuex.Store({
    state:{
        sessin:[
        ],
        user:'',
    },
    mutations:{
        addMessage(state,msg){
            state.sessin.push(msg); 
        },
        setUser(state,user){
            state.user = user;
        }
    },
    getters:{
        getUser(state){
            return state.user;
        },
        getMsg(state){
            return state.sessin;
        }
    }
})

export default store;